<!doctype html>
<HTML>
<HEAD>
<meta charset="utf-8">
<style type="text/css">
body{
font-size:100px;
text-align:center;
}
input{
width:350px;
height:140px;
font-size:80px;
}
</style>
<TITLE>点名系统</TITLE>
<SCRIPT LANGUAGE="JavaScript">
var names = [
"01","02","03","04","05","06","07"];

var name;
var index = -1;
var time;
function begin(){
document.getElementById("btnBegin").disabled = true;
chouqian();
}
function chouqian(){
if(names.length > 0){
index = Math.floor(Math.random()*1000 % names.length);
name = names[index];
document.getElementById("result").innerHTML = name;

time = window.setTimeout(chouqian,2);
}else{
document.getElementById("result").innerHTML = "~结束~";
}
}
function end(){
window.clearTimeout(time);
document.getElementById("btnBegin").disabled = false;
names.splice(index, 1);
}
</SCRIPT>
</HEAD>

<BODY>

<div>
<h3>抽签顺序</h3>
<h1 id="result" style="color:blue;">Ready Go</h1>
<INPUT TYPE="button" VALUE="开始" id="btnBegin" ONCLICK="begin();">
<INPUT TYPE="button" VALUE="结束" id="btnEnd" ONCLICK="end();">
</div>
</BODY>
</HTML>